﻿#include "CustomLineEdit.h"
#include <QMouseEvent>
#include <QDebug>
#include <QProcess>

CustomLineEdit::CustomLineEdit(QWidget* widget)
    :QLineEdit (widget)
{

}

void CustomLineEdit::mousePressEvent(QMouseEvent *ev)
{
    if(rect().contains(ev->pos()))
    {
        QProcess process;
        //bool success = process.startDetached("C:\\Windows\\WinSxS\\amd64_microsoft-windows-osk_31bf3856ad364e35_10.0.19041.3636_none_1f546a300f4325b7\\osk.exe");
        //bool success = process.startDetached("C:\\Windows\\WinSxS\\amd64_microsoft-windows-osk_31bf3856ad364e35_10.0.18362.1_none_7d1a4367d7272061\\osk.exe");
        bool success = process.startDetached("C:\\TabTip.exe");
        if (!success) {
            qWarning() << "Failed to start osk.exe:" << process.errorString();
        }
    }
    return QLineEdit::mousePressEvent(ev);
}
